package com;


import com.util.DateUtil;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

/**
 * @author :Administrator
 * @description: TODO edit class Description
 * @create date: 2021/11/12 10:54
 */
public class DateTest {
    public static void main(String[] args) throws ParseException {
        m1();
    }

    public static void m1() throws ParseException {
        Date date = new Date();
        Date startNormalizeDay = DateUtil.getStartNormalizeDay(date);
        System.out.println(DateFormatUtils.format(startNormalizeDay, "yyyy-MM-dd HH:mm:ss"));
        Date endNormalizeDay = DateUtil.getEndNormalizeDay(date);
        System.out.println(DateFormatUtils.format(endNormalizeDay, "yyyy-MM-dd HH:mm:ss"));
        System.out.println(startNormalizeDay.after(endNormalizeDay));
        System.out.println(startNormalizeDay.before(endNormalizeDay));

        Date expEndTime = DateUtil.getEndNormalizeDay(DateUtil.parseDate("2022-05-12 23:59:59","yyyy-MM-dd HH:mm:ss"));
        System.out.println(DateFormatUtils.format(expEndTime, "yyyy-MM-dd HH:mm:ss"));
        System.out.println(DateFormatUtils.format(date, "yyyy-MM-dd HH:mm:ss"));
        if (expEndTime.before(date)){
            System.out.println("会员已过期不可启用");
        }
    }
}
